using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Distance._Legacy
{
    /// <summary>
    /// <para>Cost Path</para>
    /// <para>Calculates the least-cost path from a source to a destination.</para>
    /// <para>计算从源到目标的最低开销路径。</para>
    /// </summary>    
    [DisplayName("Cost Path")]
    public class CostPath : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CostPath()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_destination_data">
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies those cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个栅格或要素数据集，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入为栅格，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_cost_distance_raster">
        /// <para>Input cost distance raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost distance raster to be used to determine the least-cost path from the destination locations to a source.</para>
        ///   <para>The cost distance raster is usually created with the Cost Distance, Cost Allocation or Cost Back Link tools. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从目标位置到源的最低成本路径的成本距离栅格的名称。</para>
        ///   <para>成本距离栅格通常使用成本距离、成本分摊或成本回溯链接工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_cost_backlink_raster">
        /// <para>Input cost backlink raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost back link raster used to determine the path to return to a source via the least-cost path.</para>
        ///   <para>For each cell in the back link raster, a value identifies the neighbor that is the next cell on the least accumulative cost path from the cell to a single source cell or set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>成本回溯链接栅格的名称，用于确定通过成本最低路径返回源的路径。</para>
        ///   <para>对于反向链接栅格中的每个像元，一个值用于标识从像元到单个源像元或一组源像元的累积成本最低路径上的下一个像元。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output cost path raster.</para>
        ///   <para>The output raster is of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出成本路径栅格。</para>
        ///   <para>输出栅格为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        public CostPath(object _in_destination_data, object _in_cost_distance_raster, object _in_cost_backlink_raster, object _out_raster)
        {
            this._in_destination_data = _in_destination_data;
            this._in_cost_distance_raster = _in_cost_distance_raster;
            this._in_cost_backlink_raster = _in_cost_backlink_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Cost Path";

        public override string CallName => "sa.CostPath";

        public override List<string> AcceptEnvironments => ["autoCommit", "compression", "configKeyword", "scratchWorkspace", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_destination_data, _in_cost_distance_raster, _in_cost_backlink_raster, _out_raster, _path_type.GetGPValue(), _destination_field, _force_flow_direction_convention.GetGPValue()];

        /// <summary>
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies those cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个栅格或要素数据集，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入为栅格，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature destination data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_destination_data { get; set; }


        /// <summary>
        /// <para>Input cost distance raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost distance raster to be used to determine the least-cost path from the destination locations to a source.</para>
        ///   <para>The cost distance raster is usually created with the Cost Distance, Cost Allocation or Cost Back Link tools. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从目标位置到源的最低成本路径的成本距离栅格的名称。</para>
        ///   <para>成本距离栅格通常使用成本距离、成本分摊或成本回溯链接工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cost distance raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cost_distance_raster { get; set; }


        /// <summary>
        /// <para>Input cost backlink raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost back link raster used to determine the path to return to a source via the least-cost path.</para>
        ///   <para>For each cell in the back link raster, a value identifies the neighbor that is the next cell on the least accumulative cost path from the cell to a single source cell or set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>成本回溯链接栅格的名称，用于确定通过成本最低路径返回源的路径。</para>
        ///   <para>对于反向链接栅格中的每个像元，一个值用于标识从像元到单个源像元或一组源像元的累积成本最低路径上的下一个像元。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cost backlink raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cost_backlink_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output cost path raster.</para>
        ///   <para>The output raster is of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出成本路径栅格。</para>
        ///   <para>输出栅格为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Path type</para>
        /// <para><xdoc>
        ///   <para>A keyword defining the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>Each cell— For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each from cell.</bullet_item><para/>
        ///     <bullet_item>Each zone— For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Best single— For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一个关键字，用于定义在成本路径计算中解释输入目标数据上的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定一个成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。</bullet_item><para/>
        ///     <bullet_item>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</bullet_item><para/>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从具有到源像元的最小开销路径的像元派生的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _path_type_value _path_type { get; set; } = _path_type_value._EACH_CELL;

        public enum _path_type_value
        {
            /// <summary>
            /// <para>Each cell</para>
            /// <para>Each cell— For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each from cell.</para>
            /// <para>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定一个成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("Each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>Each zone</para>
            /// <para>Each zone— For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</para>
            /// <para>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</para>
            /// </summary>
            [Description("Each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single— For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从具有到源像元的最小开销路径的像元派生的。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

        }

        /// <summary>
        /// <para>Destination field</para>
        /// <para><xdoc>
        ///   <para>The field used to obtain values for the destination locations.</para>
        ///   <para>Input feature data must contain at least one valid field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于获取目标位置值的字段。</para>
        ///   <para>输入要素数据必须至少包含一个有效字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_field { get; set; } = null;


        /// <summary>
        /// <para>Force flow direction convention for backlink raster</para>
        /// <para><xdoc>
        ///   <para>Forces the tool to treat the input backlink raster as a flow direction raster. Flow direction rasters can have integer values that range from 0-255.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The Input cost backlink raster will be interpreted differently based on the range of values and if it is integer or float. For a value range of 0-8, the Input cost backlink raster will be treated as a backlink raster. For values 0-255 and integer, the Input cost backlink raster will be treated as a flow direction raster. For a value range of 0-360 and floating point, the Input cost backlink raster will be treated as a back direction raster.</bullet_item><para/>
        ///     <bullet_item>Checked—The raster supplied for the Input cost backlink raster will be treated as a flow direction raster. This is necessary if the flow direction raster has a maximum value of 8 or less.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>强制工具将输入反向链接栅格视为流向栅格。流向栅格的整数值范围为 0-255。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 输入成本反向链接栅格将根据值范围以及是整数还是浮点数而以不同的方式解释。对于值范围 0-8，输入成本反向链接栅格将被视为反向链接栅格。对于值 0-255 和整数，输入成本反向链接栅格将被视为流向栅格。对于值范围 0-360 和浮点，输入成本反向链接栅格将被视为反向栅格。</bullet_item><para/>
        ///     <bullet_item>选中 - 为输入成本反向链接栅格提供的栅格将被视为流向栅格。如果流向栅格的最大值为 8 或更小，则这是必需的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Force flow direction convention for backlink raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _force_flow_direction_convention_value _force_flow_direction_convention { get; set; } = _force_flow_direction_convention_value._false;

        public enum _force_flow_direction_convention_value
        {
            /// <summary>
            /// <para>INPUT_RANGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INPUT_RANGE")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>FLOW_DIRECTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FLOW_DIRECTION")]
            [GPEnumValue("true")]
            _true,

        }

        public CostPath SetEnv(int? autoCommit = null, object compression = null, object configKeyword = null, object scratchWorkspace = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, compression: compression, configKeyword: configKeyword, scratchWorkspace: scratchWorkspace, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}